@import "mixins/util.scss";

.g-field {
  display: flex;
  color: var(--datav-gui-font-color-1);
}

.g-field-title {
  font-size: 12px;
  height: 28px;
  line-height: 28px;
  font-weight: normal;

  @include utils-ellipsis();
}

.next-line {
  .g-field-title {
    overflow: auto;
    text-overflow: inherit;
    display: inline-block;
    height: auto;
    word-break: break-all;
    white-space: normal;
  }
}

.g-field-title-with-description {
  @extend .g-field-title;

  cursor: help;
  text-decoration: underline dotted;
}

.g-field-help {
  padding: 0 3px;
  color: var(--datav-gui-font-color-base);
  font-size: 12px;
  line-height: 28px;
  cursor: pointer;

  &:hover {
    color: var(--datav-main-hover-color);
  }
}

.g-field-show-placeholder {
  display: block;
  width: 16px;
  margin-right: 4px;
  height: 25px;
  line-height: 24px;

  .n-switch__rail {
    height: 10px;
    border-radius: 2px;

    .n-switch__button {
      height: 7px;
    }

    .n-switch.n-switch--round .n-switch__rail .n-switch__button {
      border-radius: 2px;
    }
  }
}

.basic-setting-wp .g-field-container {
  width: 220px;
}

.g-field-container {
  // width: 195px;
  line-height: 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;

  &.--flat {
    display: flex;
    justify-content: space-between;
    flex-wrap: wrap;
  }

  .datav-gui.g-switch {
    &.--inline {
      padding-bottom: 6px;
    }

    .g-input__caption {
      position: relative;
      top: 0;
    }
  }

  .n-switch {
    height: 28px;
    display: flex;
    justify-content: flex-start;
    margin-top: -2px;

    .n-switch__children-placeholder {
      height: 12px;
    }
  }

  .n-switch__rail {
    height: 12px;
    width: 80% !important;
    border-radius: 2px;

    .n-switch__button {
      height: 12px;
      top: 0;
    }
  }
}

.g-field-wp {
  display: flex;
  padding: 4px 4px 8px 8px;
  border-radius: 4px;

  // &:first-child {
  //   padding-top: 0;
  // }

  &:last-child {
    padding-bottom: 16px;
  }

  .g-field {
    flex: 1;
    padding-right: 5px;
  }

  &.--lv1 {
    // background: var(--datav-gui-bgcolor-front);
  }

  &.--lv2 {
    background: var(--datav-gui-bgcolor-back);

    .g-field {
      color: var(--datav-gui-font-color-2);
    }
  }

  &.--field-disabled {
    cursor: not-allowed;

    .g-field-title {
      opacity: 0.6;
    }

    .g-field-container {
      cursor: not-allowed;
      opacity: 0.6;
      pointer-events: none;
    }
  }
}

.g-field-caption {
  font-size: 12px;
  color: var(--datav-gui-font-color-description);
  height: 16px;
  line-height: 16px;

  @include utils-ellipsis();
}
